# 生成随机验证码(n位字母)
import random

# 设计有问题的代码!!!
# def getCode(n,str=""):
#     str = str
#     for i in range(n):
#         num = random.randint(65, 122)
#         if (num < 91 or num > 96):
#             str += chr(num)
#     if(len(str) < n):
#         getCode(n - len(str),str)
#     else:
#         return str

def getCode(n):
    str = ""
    for i in range(n):
        num = random.randint(65, 122)
        if (num < 91 or num > 96):
            str += chr(num)

    if(len(str) < n):
        str += getCode(n - len(str))

    return str

print(getCode(4))
